<template>
	<view>
		<view class="head">
			<!-- 第一部分 -->
			<view class="head-top">
				<view class="head-title">
					<text>{{arr[0].name}}</text>
					<text>{{arr[0].serial}}</text>
					<view>诊断</view>
				</view>
				<view class="open">开放申赎</view>
				<view class="price">
					<view class="one">
						<text>{{arr[0].net}}</text>
						<text>最新净值(08-17)</text>
					</view>
					<view class="two">
						<text>{{arr[0].dayup}}</text>
						<text>日涨跌幅</text>
					</view>
					<view class="three">
						<text>{{arr[0].recent}}</text>
						<text>近一年收益率</text>
					</view>
				</view>
			</view>
			<!-- 第二部分 -->
			<view class="head-bottom">
				<image src="../../static/img/four.png" mode=""></image>
				<view class="classify">
					<text>中高风险</text>
					<text>混合型</text>
					<text>10.00元起购</text>
				</view>
			</view>
			<view class="ash"> </view>
		</view>
		<!-- 收益部分 -->
		<view class="history">
			<u-tabs :list="list" :is-scroll="false" :current="current" @change="change" active-color="#00d5c7"
				bar-width="100" bar-height="5"></u-tabs>
		</view>
		<!-- 近几个月 -->
		<view class="month">
			<u-subsection :list="list1" :current1="1" mode="subsection" :animation="true"
				active-color="#b3b3b3"></u-subsection>
		</view>
		<!-- 折线图 -->
		<view class="">
			<echarts />
		</view>

		<!-- 最下面一部分 -->
		<view class="bottom">
			<view class="bottom-five">
				<view class="bottom-one">
					<image src="../../static/img/star.png" mode=""></image>
					<view class="">自选</view>
				</view>
				<view class="bottom-one">
					<image src="../../static/img/PK1.png" mode=""></image>
					<view class="">比较</view>
				</view>
				<view class="bottom-one">
					<image src="../../static/img/qiu.png" mode=""></image>
					<view class="">定投模拟</view>
				</view>
			</view>

			<view class="buttom-four">
				<view class="bottom-two">
					<view class="">定投</view>
				</view>
				<view class="bottom-three">
					<view class="" @click="buy">购买</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import echarts from "../../components/echartsPage/echartsPage.vue"
	export default {
		components: {
			echarts
		},
		data() {
			return {
				list: [{
					name: '历史收益'
				}, {
					name: '单位净值'
				}, {
					name: '累计净值'
				}],
				current: 0,
				list1: [{
						name: '近1月'
					},
					{
						name: '近3月'
					},
					{
						name: '近1年'
					},
					{
						name: '成立以来'
					}
				],
				current1: 1,
				arr: {}
			}
		},
		methods: {
			change(index) {
				this.current = index;
			},
			// 跳转购买页面
			buy() {
				uni.navigateTo({
					url: "../fundBuy/fundBuy?name=" + this.arr.name
				})
			},
			onLoad(option) {
				console.log(JSON.parse(option.arr));
				let a = JSON.parse(option.arr);
				this.arr = a
			}
		}
	}
</script>

<style scoped>
	/* 头部 */
	.head-top {
		height: 280rpx;
		/* 		background-color: aqua; */
		padding: 26rpx 0;
	}

	.head-title {
		font-size: 32rpx;
		margin-left: 140rpx;
		display: flex;
		position: relative;
	}

	.head-title text:nth-child(1) {
		/* 省略号 */
		width: 300rpx;
		white-space: nowrap;
		/* 修正属性名为 nowrap */
		overflow: hidden;
		text-overflow: ellipsis;
		/* 修正属性名为 ellipsis */
		max-width: 300rpx;
		/* 添加最大宽度 */
		margin-right: 40rpx;
	}

	.head-title text:nth-child(2) {
		margin-left: 30rpx;
	}

	.head-title view {
		width: 100rpx;
		height: 50rpx;
		background-color: orange;
		font-size: 28rpx;
		color: white;
		position: absolute;
		right: 0rpx;
		padding-left: 25rpx;
		line-height: 50rpx;
		border-radius: 50rpx 0rpx 0rpx 50rpx;
	}

	/* 开放申赎 */
	.open {
		width: 140rpx;
		height: 40rpx;
		border: 1rpx solid orange;
		text-align: center;
		margin: 20rpx auto;
		color: orange;

	}

	/* 涨幅度 */
	.price {
		display: flex;
		justify-content: space-around;
		margin-top: 30rpx;
	}

	.price view {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-around;
		color: #4d4d4d;
	}

	.one text:nth-child(1) {
		font-size: 40rpx;
		font-weight: 600;
	}

	.two text:nth-child(1) {
		font-size: 40rpx;
		color: red;
	}

	.three text:nth-child(1) {
		font-size: 40rpx;
		color: green;
	}

	/* 第二部分 */
	.head-bottom {
		display: flex;
		align-items: center;
		padding: 20rpx 40rpx;
		border-top: 1rpx solid #e6e6e6;
	}

	.head-bottom image {
		width: 50rpx;
		height: 50rpx;
	}

	.classify {
		width: 80%;
		display: flex;
		justify-content: space-evenly
	}

	.classify text {
		border-right: 1rpx solid #e6e6e6;
		padding-right: 20rpx;
	}

	.classify text:nth-child(3) {
		border: 0;
	}

	.ash {
		height: 20rpx;
		width: 100%;
		background-color: #ececec;
	}

	/* 近几个月 */
	.month {
		width: 80%;
		margin: 0 auto;
		margin-top: 40rpx;
	}

	/* 底部 */
	.bottom {
		display: flex;
		justify-content: space-around;
		justify-content: flex-end;
		width: 100%;
		border-top: 1rpx solid #e6e6e6;
		position: absolute;
		bottom: 0rpx;
	}

	.bottom-one {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 120rpx;
		/* 		height: 160rpx; */
	}

	.bottom-one image {
		width: 50rpx;
		height: 50rpx;
	}

	.buttom-four {
		display: flex;
		margin-left: 10rpx;
	}

	.bottom-two,
	.bottom-three {
		width: 160rpx;
		height: 80rpx;
		background-color: orange;
		color: white;
		font-size: 36rpx;
		line-height: 80rpx;
		text-align: center;
	}

	.bottom-two {
		border-right: 1rpx white solid;
	}

	.bottom-five {
		display: flex;
		justify-content: space-around;
		width: 70%;
	}
</style>